安装 Elasticsearch

elasticsearch-head 安装

elasticsearch-head文档

1
2
3
4
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
yarn install
yarn run start

open http://localhost:9100/

安装集群

安装版本为 5.5.2,下载地址为 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz

master

修改config/elasticsearch.yml,添加如下内容

1
2
3
4
5
6
7
8
http.cors.enabled: true
http.cors.allow-origin: "*"

cluster.name: rexyan
node.name: master
node.master: true

network.host: 127.0.0.1

启动

1
./bin/elasticsearch -d

slave-1

1
2
3
4
5
6
7
cluster.name: rexyan
node.name: slave-1

network.host: 127.0.0.1
http.port: 9201

discovery.zen.ping.unicast.hosts: ["127.0.0.1"]

启动

1
./bin/elasticsearch -d

slave-2

1
2
3
4
5
6
7
cluster.name: rexyan
node.name: slave-2

network.host: 127.0.0.1
http.port: 9202

discovery.zen.ping.unicast.hosts: ["127.0.0.1"]

启动

1
./bin/elasticsearch -d

效果